﻿@{
    ViewBag.Title = "News search engine for indians. News from india, business news, hindi news, tamil news, telugu news, kannada news, malayalam news, kannada news, gujarati news, marati news | lookatnews.com";

    var languages = WebApp1.Models.LanguageModel.GetAllLanguages();

    var websites = NewsMine.DataManagers.WebSiteInfoManager.GetAllDomains();

    websites = websites.OrderBy(o => o.AlexaRank).ToList();
    //Layout = "~/Views/Shared/_3ColumnMasterLayout.cshtml";
}

<div class='container'  style="margin-left:4%;margin-right:4%;">

    <div class='row'>
  
        <form action="/search">
        <div style="margin-top:1%; text-align: center;">
            <img src="@Url.Content("~/content/img/lookatnews-boy1.jpg")" style= "max-height:300px"/>
          <div>
<a href="/" title="lookatnews.com">
            <img src="@Url.Content("~/content/img/lookatnews_final_logo_original_size.png")"/>
            </a>
            <span style="margin-left: -10px;margin-top: 20px;position: absolute;color:#999;font-weight: bolder;font-size:26px;">&#946; BETA</span>
            </div>
            <div class='input-append'>
              <input  style="height:32px;width:400px;margin-right:1px;margin-top:0px;" name="q" id="q" type="text" placeholder="Search indian news from here..."/>
            <input class="btn btn-large btn-primary"  type="submit" value="search"  />
             </div>
             <div style="margin-top:30px;">
             <b>Browse news by language: </b>
        @foreach (var lngModel in languages)
        {
        <a style="text-decoration:none;color:#800;" href="/language/@lngModel.Name">
        @lngModel.LocalName.ToUpperInvariant()</a> 
         <span> | </span>
        }
        </div>
        </div>

        </form>
    </div>
     
    



    <div style="line-height:32px;">

    <hr />

    @{
        int i = 2;

        foreach (var lngModel in languages)
        {


            var websitesForCurrentLanguage = (from wb in websites
                                              where (!string.IsNullOrEmpty(wb.Language) && wb.Language.ToLower() == lngModel.Name.ToLower())
                                              select wb).ToList();
            
            <div style="text-align:justify;text-decoration:none;color:Black;">
            <a style="text-decoration:none;color:#f00;" href="/language/@lngModel.Name">
        <h2>@lngModel.LocalName.ToUpperInvariant() </h2> </a>

        

          @foreach (var website in websitesForCurrentLanguage)
          {
              i++;


              Random rnd = new Random(i % 10);

              int reminder = rnd.Next(i / 2, i);

              if (i == 20)
              {
                  i = 0;
              }

              int minValue = 20;
              int gapValue = 200 - minValue;

              string temp = (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
                  (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
                  (minValue + rnd.Next(reminder, gapValue)).ToString();

              string color = "rgb(" + temp + ")";
              string colorWithTrans = "rgba(" + temp + ",0.7)";

              string websiteName = string.Empty;

              websiteName = website.LocalName;

              if (string.IsNullOrEmpty(websiteName))
              {
                  websiteName = website.Name;
              }
                        @*<img src="@website.Logo1Uri" style="max-width:100px;max-height:60px;padding:5px;"/>*@
                           
                           <a style="color:@color;margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" title="@website.Domain @website.Name"><b>@websiteName</b></a>
                           <b> | </b>
          }
      
      <hr />
       </div>
        
         
        
        
            
            
            
        }
        
        
        
    }
    
    </div>

</div>